import requests
import json

# API URL
url = "https://vietjet-api.vietjetair.com/booking/api/v1/search-flight"

# 请求头（Headers）
headers = {
    "accept": "application/json",
    "accept-encoding": "gzip, deflate, br, zstd",
    "accept-language": "zh-cn",
    "content-language": "zh-cn",
    "content-type": "application/json",
    "origin": "https://www.vietjetair.com",
    "referer": "https://www.vietjetair.com/",
    "sec-ch-ua": '"Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": '"Windows"',
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-site",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"
}

# 请求体（Payload）
# ⚠️ 这里你要根据实际的 POST/PATCH 数据来填写
payload = {
    'encrypted': "AmgE37lrZBK3go3K1IaVOL3tsvAyVRhtMJu97iV/sA2J2mofHeXthwLHdy8jAAuP7NeYZFpc1COXVAid2+kHheW6NdCDgCSCzC1+ypDri4gLolldI+L1WZtQ5qAtjNBcJKP1h/bjTjx9rhT/bGdqt4ssecBApwQUNX04eUo5E9It6N8ogf+ew1/avzFjsJIJHG8d5nBIlZsgQuAH1SAfJ/vADkKZUBoC/6GF/2lVglYnxtfsl0iC5Olq+qopUsNEqwud7sctuKOz9jtb51YFJZqFYnGPxSGa6Fn3unbvPE6TUxiWqgkSatVBXeD2H4LdbERzZNTiby7AnjflseGYxVYnPNIDXKb9xxKpGvnGKJOitYNfiPYQGpTp4ZBDuqqNNAE8AnehPpREu5X2Q+bkQ9ufe504IJqddLbqQ9Ojvm3uC2Uv5n1sLWBwn6qEKU17aVaFp7qTVakY/VdREUVtNFcR+1Ra55P+3oBJsd1v+UhTkaEAqKxnD2idDOmswkxcY3NM3GV15ohXvaX4Dv8pGFzndh8tZrbtJtZrcfGrXzwMKZuVCTVw6MlBfuu55dBKaP/3A4rmvllaMXRNTMkF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dAOi3Mm7ENwFd+XwVbEIjPNbeyL6BqTFfxxjQWN7X+NzMMoNVXONxpEAommAtvigktclqcA7rEL/A1KECKO5UzZpRHp7CrAkYH6WT9fxz+prkBwibcjOmGfaROCQyXEfALbwc/atBNYP1K2OZfTYytY3EfZI36ZlSM4txKtE1lvSn82+B0ejVJbOseMhpNeg3ONtN+2PYuCbGwzyU8Q3KUTIzbkRRxv+Kq9zlSieQufju78r8XUPaZUe6iIy9xYJU2UfaSU8W9adH79nMFLe/vu7zvqP3H7RJyijc5UOMkZDQqRTcVqDsI9CXbZ1VzkNWoyX5BQBZZSVexJubHxhACdFVKBcJafo64/WxJcra6QNn3K"}

# 发起 PATCH 请求
response = requests.patch(url, headers=headers, data=json.dumps(payload))

# 检查状态码
print(f"Status Code: {response.status_code}")

# 打印返回的 JSON 数据
print(response.json())
